package com.qianxx.component.activity.switcher.switch_compat;

import android.os.Bundle;
import android.support.v7.widget.SwitchCompat;
import android.widget.CompoundButton;
import android.widget.Toast;

import com.qianxx.component.R;
import com.qianxx.component.activity.base.BaseActivity;

import butterknife.BindView;
import butterknife.ButterKnife;

public class SwitchCompatActivity extends BaseActivity {
    @BindView(R.id.switch_compat)
    SwitchCompat switch_compat;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_switch_compat);
        ButterKnife.bind(this);

        switch_compat.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                Toast.makeText(getApplicationContext(),isChecked+"",Toast.LENGTH_SHORT).show();
            }
        });
    }

    @Override
    public String setTitle() {
        return "SwitchCompat";
    }
}
